package emumTest;

/**
 * @ClassName EnumTest5
 * @Description
 * @Author LIBOFEI
 * @Date 2020/6/7 14:43
 * @Version 1.0
 **/
enum RoShamBo6{

    Paper,Scissor,Rock;

    public static OutCome[][] table = {
            {OutCome.DRAW,OutCome.LOSE,OutCome.WIN},//paper
            {OutCome.WIN,OutCome.DRAW,OutCome.LOSE},//Scissor
            {OutCome.LOSE,OutCome.WIN,OutCome.DRAW}//rock
    };

    public  OutCome complete(RoShamBo6 item){
        return table[this.ordinal()][item.ordinal()];
    }
}

public class EnumTest5 {

    public static void main(String[] args) {
        OutCome o = RoShamBo6.Paper.complete(RoShamBo6.Rock);
        System.out.println(o);
    }
}
